import 'dart:io';

import 'package:my_flutter_core/models/system_info.dart';
import 'package:package_info_plus/package_info_plus.dart';

/// Gets current system info.
Future<SystemInfo> getSystemInfo() async {
  return SystemInfo(
    operatingSystem: Platform.operatingSystem,
    operatingSystemVersion: Platform.operatingSystemVersion,
    platformVersion: Platform.version,
    appVersion: await getAppLocalVersion(),
  );
}

/// Gets app local version.
Future<String> getAppLocalVersion() async {
  final packageInfo = await PackageInfo.fromPlatform();
  return packageInfo.version;
}
